<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>影推</title>
    <script type="text/javascript">
      (function() {
          var docEl = document.documentElement;
  
  
          function setRemUnit() {
              // 获取到rem的基准值
              var rem = 100 * docEl.clientWidth / 375;
  
              // 动态设置html根元素的font-size
              docEl.style.fontSize = rem + 'px';
          }
  
          setRemUnit();
  
          // 窗口大小变化时 触发
          window.addEventListener('resize', setRemUnit);
  
          // 窗口出现在当前屏幕时 （有浏览器兼容性）
          window.addEventListener('pageshow', function(e) {
              if (e.persisted) {
                  setRemUnit();
              }
          });
      })();
      </script>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
